Skip to content

Modify Grafana AlertHookController to create AzDO work items instead of GitHub issues#6578

Merged
missymessa merged 1 commit into
mainfrom
feature/grafana-alerts-to-azdo
May 22, 2026
Merged

Modify Grafana AlertHookController to create AzDO work items instead of GitHub issues#6578
missymessa merged 1 commit into
mainfrom
feature/grafana-alerts-to-azdo

Conversation

@missymessa
Copy link
Copy Markdown
Member

Summary

Rewrites the Grafana alert webhook handler (AlertHookController) to create DNCENG Task work items in Azure DevOps instead of opening GitHub issues. This consolidates alert tracking into AzDO, our primary work tracker.

Changes

AlertHookController (rewritten)

  • Removed all Octokit/GitHub dependencies from the alert path
  • Now uses IAzureDevOpsClient with Managed Identity authentication
  • Alert lifecycle:
    • Alert fires: Creates work item in Backlog state with Grafana Alert + Active Alert tags
    • Alert resolves: Moves work item to Done, swaps to Inactive Alert tag
    • Recurrence: Reopens existing work item (found via WIQL search on automation ID in Description)
  • Area path: internal.NET Engineering Services\First Responders

AzureDevOpsClient extensions

  • CreateWorkItemAsync: creates work items with configurable area path
  • UpdateWorkItemAsync: PATCH updates to work item fields
  • AddWorkItemCommentAsync: adds discussion comments
  • QueryWorkItemsAsync: runs WIQL queries and returns full work items

Configuration

  • New AzureDevOpsAlert config section (mapped to AzureDevOpsAlertOptions)
  • Fields: Organization, Project, AreaPath, WorkItemType, TitlePrefix, SupplementalBodyText

Tests

  • Updated to reflect new controller constructor and public API

Resolves

https://dnceng.visualstudio.com/internal/_workitems/edit/8579

@missymessa missymessa force-pushed the feature/grafana-alerts-to-azdo branch from fad5e6c to e87dac8 Compare May 21, 2026 19:35
…b issues

Rewrites the Grafana alert webhook handler to create DNCENG Task work items
in Azure DevOps (area path: .NET Engineering Services\First Responders)
instead of opening GitHub issues.

Key changes:
- AlertHookController now uses IAzureDevOpsClient with Managed Identity auth
- Removed Octokit/GitHub dependencies from the alert path
- Alert fires: creates work item in Backlog state with 'Active Alert' tag
- Alert resolves: moves work item to Done with 'Inactive Alert' tag
- Reuses existing work items on recurrence (WIQL search by automation ID)
- Added CreateWorkItemAsync, UpdateWorkItemAsync, AddWorkItemCommentAsync,
  and QueryWorkItemsAsync to IAzureDevOpsClient
- New AzureDevOpsAlertOptions config section ('AzureDevOpsAlert')
- Updated unit tests to match new controller signature

Resolves: https://dnceng.visualstudio.com/internal/_workitems/edit/8579

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@missymessa missymessa force-pushed the feature/grafana-alerts-to-azdo branch from e87dac8 to 16029c7 Compare May 21, 2026 20:01
@missymessa missymessa merged commit 6adf07c into main May 22, 2026
5 of 6 checks passed
@missymessa missymessa deleted the feature/grafana-alerts-to-azdo branch May 22, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants